/*
 *	LineChartWidget.h
 *
 * 	Copyright (C) 2011 Aaron Huang
 * 	This file is part of StackPainter.
 *
 * 	StackPainter is free software: you can redistribute it and/or modify
 * 	it under the terms of the GNU General Public License as published by
 * 	the Free Software Foundation, either version 3 of the License, or
 * 	(at your option) any later version.
 *
 * 	StackPainter is distributed in the hope that it will be useful,
 * 	but WITHOUT ANY WARRANTY; without even the implied warranty of
 * 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 	GNU General Public License for more details.
 *
 * 	You should have received a copy of the GNU General Public License
 * 	along with StackPainter.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef LINECHARTWIDGET_H_
#define LINECHARTWIDGET_H_

#include <QWidget>
#include <QMap>

template <typename T>
class LineChartWidget : public QWidget {
public:
	LineChartWidget(QWidget* parent = 0);

	virtual ~LineChartWidget();

	void setData(const QMap<int, T>* data);

protected:
	void paintEvent(QPaintEvent *);

private:
	void findBound(const QList<T> values, double& min, double& max);

	const QMap<int, T>* _data;
};

#endif /* LINECHARTWIDGET_H_ */
